package com.mesd.killer.ui.cellEditor;

import java.awt.Color;
import java.awt.Component;

import javax.swing.AbstractCellEditor;
import javax.swing.JTable;
import javax.swing.table.TableCellEditor;

import com.mesd.killer.ui.tools.MyJLabel;

public class LabelEditor extends  AbstractCellEditor implements TableCellEditor {
	protected MyJLabel label;  
	 
	public LabelEditor()
	{
		 label = new MyJLabel();  
		 label.setBackground( Color.white); 
	}
	
	@Override
	public Object getCellEditorValue() {
		return label.getText();
	}

	@Override
	public Component getTableCellEditorComponent(JTable table, Object value,
			boolean isSelected, int row, int column) {
		label.setText(value == null ? "" : value.toString());
		return label;
	}  

}
